/**
 * Created by dale on 2017/9/12.
 */
$(document).ready(function () {


    var form = new xhForm($('#xh_form'));
    form.parse();
    if(typeInfo!='1'){
        form.fill(typeInfo);  
    }
    form.bindRequired($('#bt_modal_confirm',parent.document));
    
    $('#bt_modal_confirm',parent.document).click(function () {
        $.ajax({
            url:baseUrl+'ims/product/saveType',
            data:$('#xh_form').serialize(),
            type:'POST',
            success:function (data) {
                $('#bt_modal_confirm',parent.document).addClass('disabled');

                window.top.xhTop.getActiveFrame().typeList.datagrid('reload');
                window.top.xhTop.closeModal();
    
            },
            error:function (data) {
                window.top.swal(
                    data['responseText'],
                    '',
                    'error'
                );
            }
        });
    });
    
    // modalBind.bindClick();

});